<?php
class Translator {
	
	private $_dictId = '';
	
	private $_leksId = '';
	
	private $_model = null;
	
	public function __construct($dictId, $leksId) {
		$this->_leksId = $leksId;
		$this->_dictId = $dictId;
		$this->_model = new TranslatorObjModel();
	}
	
	public function saveTranslation($translation) {
		return $this->_model->saveTranslation($translation, $this->_leksId, $this->_dictId);
	}

	public function updatetranslation($translation) {
		return $this->_model->updateTranslation($translation, $this->_leksId, $this->_dictId);
	}

	public function getTranslation() {
		if($this->_dictId == 'base') {
			return $this->_model->getOriginal($this->_leksId);
		}
		return $this->_model->getTranslation($this->_leksId, $this->_dictId);
	}
}